#include <stdio.h>
#include <math.h>

int main(int argc, char const *argv[])
{
    long long i = pow(2, 16), j, low, high;
    scanf("%lld", &j);
    low = j % i;
    high = j / i;
    low = low << 16;
    low += high;
    printf("%lld", low);
    return 0;
}
